import 'package:environmental_les_app/common/style/colours.dart';
import 'package:flutter_clx_base/flutter_clx_base.dart';

class BottomPopWindowBg extends StatelessWidget {
  final List<Widget>? children;
  final String title;
  const BottomPopWindowBg({super.key, this.children, required this.title});

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Stack(
        children: [
          Container(
            padding: const EdgeInsets.symmetric(horizontal: 10),
            decoration: const BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(20),
                topRight: Radius.circular(20),
              ),
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: [
                vGap30,
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text(title,
                        style: const TextStyle(
                            fontSize: 18,
                            color: Colours.textC4C,
                            fontWeight: FontWeight.bold)),
                  ],
                ),
                vGap20,
                ...?children,
                vGap30,
              ],
            ),
          ),
          Positioned(
            top: 30,
            right: 10,
            child: InkWell(
              onTap: () {
                Navigator.of(context).pop();
              },
              child: Container(
                width: 30,
                height: 30,
                alignment: Alignment.center,
                decoration: const BoxDecoration(
                  shape: BoxShape.circle,
                  color: Colours.bgF4F7FD,
                ),
                child: const Icon(
                  Icons.close,
                  color: Colours.iconColor,
                  size: 20,
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
